package com.hskn.hss.module.casesetsys.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hskn.hss.exception.HssException;
import com.hskn.hss.module.casesetsys.entity.CasesetSys;
import com.hskn.hss.module.casesetsys.mapper.CasesetSysMapper;
import com.hskn.hss.module.casesetsys.service.ICasesetSysService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author hskn
 * @since 2021-05-18
 */
@Service
public class CasesetSysServiceImpl extends ServiceImpl<CasesetSysMapper, CasesetSys> implements ICasesetSysService {

    @Resource
    private CasesetSysMapper casesetSysMapper;

    @Override
    public void mUpdate(JSONObject params) throws HssException {

        CasesetSys casesetSys = JSON.parseObject(params.toJSONString(), CasesetSys.class);
        casesetSys.setCasesetSysId("1");
        casesetSysMapper.updateById(casesetSys);
    }

    @Override
    public CasesetSys detail(JSONObject params) throws HssException {

        CasesetSys casesetSys = casesetSysMapper.selectById(1);
        casesetSys.setCasesetSysId(null);
        return casesetSys;
    }
}
